---
title: "JQuery Snippets"
date: 2017
categories:
- js
tags:
---

<div id="content">
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org6c7a6ff">JQuery Code Snippets</a>
<ul>
<li><a href="#org8e2f5ad">Check or uncheck Checkbox and RadioButton</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="outline-2" id="outline-container-org6c7a6ff">
<h2 id="org6c7a6ff">JQuery Code Snippets</h2>
<div class="outline-text-2" id="text-org6c7a6ff">
</div>
<div class="outline-3" id="outline-container-org8e2f5ad">
<h3 id="org8e2f5ad">Check or uncheck Checkbox and RadioButton</h3>
<div class="outline-text-3" id="text-org8e2f5ad">
<div class="org-src-container">
<pre class="src src-js"><span style="font-weight: bold; font-style: italic;">// </span><span style="font-weight: bold; font-style: italic;">Check #x</span>
$( <span style="font-style: italic;">"#x"</span> ).prop( <span style="font-style: italic;">"checked"</span>, <span style="font-weight: bold; text-decoration: underline;">true</span> );

<span style="font-weight: bold; font-style: italic;">// </span><span style="font-weight: bold; font-style: italic;">Uncheck #x</span>
$( <span style="font-style: italic;">"#x"</span> ).prop( <span style="font-style: italic;">"checked"</span>, <span style="font-weight: bold; text-decoration: underline;">false</span> );

<span style="font-weight: bold; font-style: italic;">// </span><span style="font-weight: bold; font-style: italic;">get checked value</span>
$(<span style="font-style: italic;">'input:radio[name="options"]:checked'</span>).val()
</pre>
</div>
</div>
</div>
</div>
</div>
<div class="status" id="postamble">
<p class="date">Date: 2017</p>
<p class="author">Author: gdme1320</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
